package edu.unu.iist.ts2es.ui;

import java.awt.BorderLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.BorderFactory;

import edu.uci.ics.jung.visualization.GraphZoomScrollPane;

public class VVPanel extends GraphZoomScrollPane{
	

	private static final long serialVersionUID = 1L;
	private VVPanel instance = this;
	private AGraphEditor editor;
	
	public VVPanel(AGraphEditor editor, String title, boolean isChagable){
		super(editor.getViewer());
		init();
		this.setBorder(BorderFactory.createTitledBorder(title));
		this.editor = editor;
		if(isChagable)
			// TODO
			this.add(editor.getModeComboBox(),BorderLayout.NORTH);
	}

	public void init(){
		this.setFocusable(true);
		addMouseListener(new MouseAdapter() { 
	          public void mousePressed(MouseEvent me) { 
	            instance.requestFocusInWindow();
	          } 
	        }); 
	}
	
	public AGraphEditor getGraphEditor(){
		return this.editor;
	}

}
